#pragma once

#include <QWidget>
#include "ui_AudioPlayWidget.h"
#include "AudioPlay.h"
#include <QTime>
class QTimer;
class AudioPlayWidget : public QWidget , public AudioPlay
{
	Q_OBJECT

public:
	AudioPlayWidget(QWidget *parent = Q_NULLPTR);
	~AudioPlayWidget();

protected:
	void paintEvent(QPaintEvent *event);

private:
	int Random(int maxvalue);
private slots:
	void Timeout();

private:
	Ui::AudioPlayWidget ui;

	QTimer* timer = Q_NULLPTR;

	float rotation = 0;

	QTime time;

	bool needUpdate = false;

	float decibels_show[DECIBEL_ARRAY_SIZE];
};
